import {useEffect} from 'react'
import MainLayout from './layout/MainLayout';
import { HashRouter as Router, Route, Switch, withRouter } from "react-router-dom"
import Routes from './Routes';
import Login from './pages/login/Login';

function App() {
  useEffect(() => {
    return () => {
      console.log("UnMountSelectedKeys");
    }
  }, [])
  if(window.location.hash === '#/login') {
    return (
      <Router>
        <Route path="/login" component={Login} />
      </Router>
    )
  }else {
    return (
        <Router>
          <Route path="/" component={MainLayout(Routes)} />
        </Router>
    );
  }
}

export default App;
